* src/fns.c (hash_string): Suppress warning on 32-bit platforms
authorMattias Engdegård <mattiase@acm.org>
Thu, 22 Feb 2024 19:15:33 +0000 (20:15 +0100)
committerMattias Engdegård <mattiase@acm.org>
Fri, 23 Feb 2024 10:09:49 +0000 (11:09 +0100)
Remove a shift-too-wide complaint by GCC in code that is never reached
on platforms where that shift is too wide.

src/fns.c

index 0a9692f36e82da3e3e5ed84372b87911b2f28ff1..737757d06ccc69ae52e0b438d87ce39693f6e482 100644 (file)
--- a/src/fns.c
+++ b/src/fns.c
@@ -5086,6 +5086,8 @@ hash_string (char const *ptr, ptrdiff_t len)
       /* String is shorter than an EMACS_UINT.  Use smaller loads.  */
       eassume (p <= end && end - p < sizeof (EMACS_UINT));
       EMACS_UINT tail = 0;
+      verify (sizeof tail <= 8);
+#if EMACS_INT_MAX > INT32_MAX
       if (end - p >= 4)
        {
          uint32_t c;
@@ -5093,6 +5095,7 @@ hash_string (char const *ptr, ptrdiff_t len)
          tail = (tail << (8 * sizeof c)) + c;
          p += sizeof c;
        }
+#endif
       if (end - p >= 2)
        {
          uint16_t c;